<div class="wrapper-bz-page" style="height:100%;
    width:100%;
    overflow:hidden;
    position:relative;">
    <div class="dialog-search-box">
        <input style="width:250px"  id="search_input_switch_poem_activity_plan_calendar" />
    </div>
    <div class="wrapper-bz-body">
        <table id="table_lib_poem_in_clockin_activity_plan" style="width:100%;height:94%"></table>
    </div>
</div>

<script>
    $(function () {
        var listTable = [
            {subject_keyword: "lib_poem_in_clockin_activity_plan", page_code: "lib_poem_in_activity_plan"},
        ];
        var planDate = "{$planDate}";
        var clockinActivityId = "{$clockinActivityId}";
        var tableObject_1 = $("#table_" + listTable[0].subject_keyword);

        var datagridConfigList = $(document).getDatagridConfig(listTable);
        var datagridConfig = datagridConfigList[0];
        datagridConfig.onCheck = function(index, row){
            // setPoemClockinActivityPlan(clockinActivityId, planDate, row.id);
            // $("#dialog_add_poem_clockin_activity_plan_calendar_in_add_clockin_activity_plan").dialog("close");
            // //刷新日历计划
            // const calendarEl = document.getElementById('table_poem_clockin_activity_plan_calendar_in_add_clockin_activity_plan')
            // const calendar = new FullCalendar.Calendar(calendarEl);
            // calendar.render();
        };
        tableObject_1.datagrid(datagridConfig);
        SearchCombobox('search_input_switch_poem_activity_plan_calendar','table_lib_poem_in_clockin_activity_plan',function (val,name) {
            datagridConfig.queryParams[name] = val;
            tableObject_1.datagrid(datagridConfig);
        },['CK','ID','创建时间']);

        function setPoemClockinActivityPlan(clockinActivityId, planDate, subjectId)
        {
            $.ajax({
                url: '/api/ClockinActivityPlan/addClockinActivityPlan',
                async: false,
                type:'post',
                data:{clockin_activity_id: clockinActivityId, plan_date:planDate, subject_id:subjectId, content_type:1},
                success:function(resp){
                    if( 0 == resp.code ){
                        layer.msg(resp.message);
                    }
                }
            });
        }
    });
</script>